<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 
<h:head>
</h:head>
<h:body style="width:900;">
<div id="parte_sinistra" style="float:left;width: 200;">
        Select where you want to go: <br />
        <h:link outcome="admins/home" value="To the admin section" /> <br /> 
        <h:link outcome="users/home" value="To the user section" />
</div>
<div id="parte_destra" style="float:right;width:600;">
<h:form>
		<p:panel header="Registration Form">
			<h:panelGrid columns="6" id="regGrid">
				<h:outputLabel for="email">Email:</h:outputLabel>
				<p:inputText id="email" value="#{registerBean.user.email}" />
				<p:message for="email" />

				<h:outputLabel for="name">Nome:</h:outputLabel>
				<p:inputText id="name" value="#{registerBean.user.name}" />
				<p:message for="name" />

				<h:outputLabel for="surname">Cognome:</h:outputLabel>
				<p:inputText id="surname" value="#{registerBean.user.surname}" />
				<p:message for="surname" />
				
				<h:outputLabel for="username">Username:</h:outputLabel>
				<p:inputText id="username" value="#{registerBean.user.username}" />
				<p:message for="username" />

				<h:outputLabel for="password">Password:</h:outputLabel>
				<p:password id="password" value="#{registerBean.user.password}"
					feedback="true" match="pwd2" label="Password"/>
				<p:message for="password" />

				<h:outputLabel for="pwd2">Conferma Password:</h:outputLabel>
				<p:password id="pwd2" label="Confirm Password" value="#{registerBean.user.password}"/>
				<p:message for="pwd2" />
				
				<h:outputLabel for="street">Via:</h:outputLabel>
				<p:inputText id="street" value="#{registerBean.address.street}" />
				<p:message for="street" />
				
				<h:outputLabel for="streetNumber">Numero Civico:</h:outputLabel>
				<p:inputText id="streetNumber" value="#{registerBean.address.streetNumber}" />
				<p:message for="streetNumber" />
				
				<h:outputLabel for="city">Città:</h:outputLabel>
				<p:inputText id="city" value="#{registerBean.address.city}" />
				<p:message for="city" />
				
				<h:outputLabel for="cap">Cap:</h:outputLabel>
				<p:inputText id="cap" value="#{registerBean.address.cap}" />
				<p:message for="cap" />
				
				<h:outputLabel for="district">Provincia:</h:outputLabel>
				<p:inputText id="district" value="#{registerBean.address.district}" />
				<p:message for="district" />
				
				<h:outputLabel for="nation">Nazione:</h:outputLabel>
				<p:inputText id="nation" value="#{registerBean.address.nation}" />
				<p:message for="nation" />
			
			</h:panelGrid>
			<p:commandButton value="Register" update="regGrid" action="#{registerBean.register()}" />
		</p:panel>
	</h:form>
</div>
    </h:body>
</html>